<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PID_Study: E:/STM32CubeIDEWorkspace/noRTOS/PID_Study/Drivers/BSP/Inc/keyled.h 源文件</title>
<link rel="icon" href="Doxygen-55px.png" type="image/x-icon" />
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="Doxygen-55px.png"/></td>
  <td id="projectalign">
   <div id="projectname">PID_Study<span id="projectnumber">&#160;v1.0.0</span>
   </div>
   <div id="projectbrief">doc for PID_Study</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a href="dir_0c97d201d54b8b5817233953fc3aadb6.html">STM32CubeIDEWorkspace</a></li><li class="navelem"><a href="dir_f3310f12da31771255acec658cd4246d.html">noRTOS</a></li><li class="navelem"><a href="dir_8022218a35d1971722714ae72b00e870.html">PID_Study</a></li><li class="navelem"><a href="dir_17bc370c857333bc4166d76f67bb735c.html">Drivers</a></li><li class="navelem"><a href="dir_b62ba9d628590829d5c152676ba50098.html">BSP</a></li><li class="navelem"><a href="dir_a3931c23c62a4333dd07fbd46d82639c.html">Inc</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">keyled.h</div></div>
</div><!--header-->
<div class="contents">
<a href="keyled_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#ifndef __KEYLED_H__</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#define __KEYLED_H__</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &quot;main.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#ifdef LED1_Pin</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#define LED1_ON() HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET)</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#define LED1_OFF() HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET)</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#define LED1_TOGGLE() HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin)</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="keyled_8h.html#ac2491095a425d82ae937bb194de40961">   27</a></span><span class="preprocessor">#define KEY_ON GPIO_PIN_RESET</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="keyled_8h.html#a7064269890c7e047ff576207dcc9b178">   33</a></span><span class="preprocessor">#define KEY_OFF GPIO_PIN_SET</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span></div>
<div class="foldopen" id="foldopen00038" data-start="{" data-end="};">
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="struct_k_e_y.html">   38</a></span><span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>{</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="struct_k_e_y.html#a1cb502d7339fa12f24109da591102eb2">   40</a></span>    GPIO_TypeDef *<a class="code hl_variable" href="struct_k_e_y.html#a1cb502d7339fa12f24109da591102eb2">GPIOx</a>;     </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="struct_k_e_y.html#a0beac3d072f6aaaae29e9e2e400b2f11">   41</a></span>    uint16_t <a class="code hl_variable" href="struct_k_e_y.html#a0beac3d072f6aaaae29e9e2e400b2f11">GPIO_Pin</a>;       </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="struct_k_e_y.html#a3cd2aaf1ecd5770023b71d88040afc6d">   42</a></span>    uint32_t <a class="code hl_variable" href="struct_k_e_y.html#a3cd2aaf1ecd5770023b71d88040afc6d">KeyMask</a>;        </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="struct_k_e_y.html#a9000d704ffca4314ecd8be85b58b3482">   43</a></span>    void (*<a class="code hl_variable" href="struct_k_e_y.html#a9000d704ffca4314ecd8be85b58b3482">KeyAction</a>)(void); </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>} <a class="code hl_struct" href="struct_k_e_y.html">KEY</a>;</div>
</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="keyled_8h.html#ace9ae71c88b36af9d91a3d3d6d7bd5db">   50</a></span><span class="preprocessor">#define KEYNUMMER 8</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span><span class="comment">/*-------------------------------------------------------------*/</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="keyled_8h.html#a9a79e08fdc349f66a351a51bb8d08e7e">   66</a></span><span class="preprocessor">#define K1_MASK ((uint32_t)0x0001)</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="keyled_8h.html#a4caf9c54f7fa5f48653dd433679943e6">   71</a></span><span class="preprocessor">#define K2_MASK ((uint32_t)0x0002)</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="keyled_8h.html#a42e6d953a6f4c5b5ad6cbe726d927721">   76</a></span><span class="preprocessor">#define K3_MASK ((uint32_t)0x0004)</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="keyled_8h.html#a78397d1f0f17e4c0991215cdd97771ca">   81</a></span><span class="preprocessor">#define K4_MASK ((uint32_t)0x0008)</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="keyled_8h.html#ad69ad86ce414eab64e04d450955a38c7">   86</a></span><span class="preprocessor">#define K5_MASK ((uint32_t)0x0010)</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="keyled_8h.html#a121a9679e2e68670366d636254d1cd88">   91</a></span><span class="preprocessor">#define K6_MASK ((uint32_t)0x0020)</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"><a class="line" href="keyled_8h.html#a585a4beb84cf6cb53446d4ff12a6866d">   96</a></span><span class="preprocessor">#define K7_MASK ((uint32_t)0x0040)</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="keyled_8h.html#a02e0b0f73b4e7b7bac92ee546460699d">  101</a></span><span class="preprocessor">#define K8_MASK ((uint32_t)0x0080)</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="keyled_8h.html#ad0c475de6664a29bd77b0a977b7be38b">  106</a></span><span class="preprocessor">#define KEY_MASK ((uint32_t)0x00FF)</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="keyled_8h.html#a91fa1110d81cc96675036a9dc895db23">  113</a></span><span class="preprocessor">#define IS_KEYMASK(mask) (((((uint32_t)mask) &amp; GPIO_PIN_MASK) != 0x00u) &amp;&amp; ((((uint32_t)mask) &amp; ~GPIO_PIN_MASK) == 0x00u))</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span>uint8_t <a class="code hl_function" href="keyled_8h.html#a163c33d782903dc5b144a6ece1765bf8">Key_Register</a>(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t KeyMask, <span class="keywordtype">void</span> (*KeyAction)(<span class="keywordtype">void</span>));</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span><span class="keywordtype">void</span> <a class="code hl_function" href="keyled_8h.html#a726ac7d6b0f3fe5a3754e954a17a2e61">Key_Read_block</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span><span class="keywordtype">void</span> <a class="code hl_function" href="keyled_8h.html#ad42fb9ae531cdf757d1e6b7138611068">Key_Read_unblock</a>(uint32_t division);</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span></div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>uint32_t <a class="code hl_function" href="keyled_8h.html#a932200eb589077d9d88b9b8bcff5fac8">Key_Flag_Receive</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span><span class="keywordtype">void</span> <a class="code hl_function" href="keyled_8h.html#afa4846032f413dbd897fb0a2317df759">Key_Flag_Action</a>(uint32_t KeyFlag);</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span> </div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span><span class="preprocessor">#endif </span><span class="comment">/*__ KEYLED_H__ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="akeyled_8h_html_a163c33d782903dc5b144a6ece1765bf8"><div class="ttname"><a href="keyled_8h.html#a163c33d782903dc5b144a6ece1765bf8">Key_Register</a></div><div class="ttdeci">uint8_t Key_Register(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t KeyMask, void(*KeyAction)(void))</div><div class="ttdoc">注册按键</div><div class="ttdef"><b>定义</b> keyled.c:25</div></div>
<div class="ttc" id="akeyled_8h_html_a726ac7d6b0f3fe5a3754e954a17a2e61"><div class="ttname"><a href="keyled_8h.html#a726ac7d6b0f3fe5a3754e954a17a2e61">Key_Read_block</a></div><div class="ttdeci">void Key_Read_block(void)</div><div class="ttdoc">阻塞方式读取按键</div><div class="ttdef"><b>定义</b> keyled.c:73</div></div>
<div class="ttc" id="akeyled_8h_html_a932200eb589077d9d88b9b8bcff5fac8"><div class="ttname"><a href="keyled_8h.html#a932200eb589077d9d88b9b8bcff5fac8">Key_Flag_Receive</a></div><div class="ttdeci">uint32_t Key_Flag_Receive(void)</div><div class="ttdoc">获取按键标志位</div><div class="ttdef"><b>定义</b> keyled.c:121</div></div>
<div class="ttc" id="akeyled_8h_html_ad42fb9ae531cdf757d1e6b7138611068"><div class="ttname"><a href="keyled_8h.html#ad42fb9ae531cdf757d1e6b7138611068">Key_Read_unblock</a></div><div class="ttdeci">void Key_Read_unblock(uint32_t division)</div><div class="ttdoc">非阻塞方式读取按键</div><div class="ttdef"><b>定义</b> keyled.c:102</div></div>
<div class="ttc" id="akeyled_8h_html_afa4846032f413dbd897fb0a2317df759"><div class="ttname"><a href="keyled_8h.html#afa4846032f413dbd897fb0a2317df759">Key_Flag_Action</a></div><div class="ttdeci">void Key_Flag_Action(uint32_t KeyFlag)</div><div class="ttdoc">按键标志位动作处理</div><div class="ttdef"><b>定义</b> keyled.c:142</div></div>
<div class="ttc" id="astruct_k_e_y_html"><div class="ttname"><a href="struct_k_e_y.html">KEY</a></div><div class="ttdoc">按键结构体定义</div><div class="ttdef"><b>定义</b> keyled.h:39</div></div>
<div class="ttc" id="astruct_k_e_y_html_a0beac3d072f6aaaae29e9e2e400b2f11"><div class="ttname"><a href="struct_k_e_y.html#a0beac3d072f6aaaae29e9e2e400b2f11">KEY::GPIO_Pin</a></div><div class="ttdeci">uint16_t GPIO_Pin</div><div class="ttdef"><b>定义</b> keyled.h:41</div></div>
<div class="ttc" id="astruct_k_e_y_html_a1cb502d7339fa12f24109da591102eb2"><div class="ttname"><a href="struct_k_e_y.html#a1cb502d7339fa12f24109da591102eb2">KEY::GPIOx</a></div><div class="ttdeci">GPIO_TypeDef * GPIOx</div><div class="ttdef"><b>定义</b> keyled.h:40</div></div>
<div class="ttc" id="astruct_k_e_y_html_a3cd2aaf1ecd5770023b71d88040afc6d"><div class="ttname"><a href="struct_k_e_y.html#a3cd2aaf1ecd5770023b71d88040afc6d">KEY::KeyMask</a></div><div class="ttdeci">uint32_t KeyMask</div><div class="ttdef"><b>定义</b> keyled.h:42</div></div>
<div class="ttc" id="astruct_k_e_y_html_a9000d704ffca4314ecd8be85b58b3482"><div class="ttname"><a href="struct_k_e_y.html#a9000d704ffca4314ecd8be85b58b3482">KEY::KeyAction</a></div><div class="ttdeci">void(* KeyAction)(void)</div><div class="ttdef"><b>定义</b> keyled.h:43</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
